/**
 * 
 */
package pacMan;

import java.awt.Color;

/**
 * 
 * Class: WindowParameters
 * Defines the parameters of the JFrame where we draw the game board objects, as
 * well as the scale of the objects to be drawn and the background and Wall colors.
 *
 * @author Tomas Rivera
 * @version $Id$
 */
public class WindowParameters {

	//////////////////////////////////////////////////////////
	// Constructor methods
	//////////////////////////////////////////////////////////
	
	/**
	 * 
	 * @param w
	 * @param h
	 * @param scale
	 * @param offsetX
	 * @param offsetY
	 * @param wallColor
	 */
	public WindowParameters(int w, int h, int scale, int offsetX, int offsetY, Color wallColor) {
		windowHeight = h;
		windowWidth = w;
		pixelOffsetX = offsetX;
		pixelOffsetY = offsetY;
		pixelScale = scale;
		this.wallColor = wallColor;
		System.out.println(String.format("(Window) width: %d, height: %d, offsetX: %d, offsetY: %d, scale: %d", windowWidth, windowHeight, pixelOffsetX, pixelOffsetY, pixelScale));
	}

	//////////////////////////////////////////////////////////
	// Public methods
	//////////////////////////////////////////////////////////
	
	/**
	 * Get the current height of the JFrame.
	 * @return
	 */
	public int getWindowHeight() {
		return windowHeight;
	}
	
	/**
	 * Update the height of the JFrame with specified value.
	 * 
	 * @param windowHeight
	 */
	public void setWindowHeight(int windowHeight) {
		this.windowHeight = windowHeight;
	}
	
	/**
	 * Get the current width of the JFrame.
	 * @return
	 */
	public int getWindowWidth() {
		return windowWidth;
	}
	
	/**
	 * Update the width of the JFrame with specified value.
	 * 
	 * @param windowWidth
	 */
	public void setWindowWidth(int windowWidth) {
		this.windowWidth = windowWidth;
	}

	/**
	 * Get the current size of a tile location.
	 * 
	 * @return
	 */
	public int getPixelScale() {
		return pixelScale;
	}
	
	/**
	 * Get the recommended size parameter for drawing Actors on-screen.
	 * @return
	 */
	public int getActorScale() {
		return (pixelScale * 150 / 100);
	}

	/**
	 * Update the size of our tile locations.
	 * 
	 * @param pixelScale
	 */
	public void setPixelScale(int pixelScale) {
		this.pixelScale = pixelScale;
	}
	
	/**
	 * Get the pixel offset from the left side of the screen, which is
	 * where we start drawing the GameBoard.
	 * @return
	 */
	public int getPixelOffsetX() {
		return pixelOffsetX;
	}

	/**
	 * Update the pixel offset for the GameBoard in relation to the left
	 * side of the screen.
	 * 
	 * @param pixelOffsetX
	 */
	public void setPixelOffsetX(int pixelOffsetX) {
		this.pixelOffsetX = pixelOffsetX;
	}

	/**
	 * Get the pixel offset from the top of the screen, which is
	 * where we start drawing the GameBoard.
	 * 
	 * @return
	 */
	public int getPixelOffsetY() {
		return pixelOffsetY;
	}

	/**
	 * Update the pixel offset for the GameBoard in relation to the top
	 * of the screen.
	 * 
	 * @param pixelOffsetY
	 */
	public void setPixelOffsetY(int pixelOffsetY) {
		this.pixelOffsetY = pixelOffsetY;
	}
	
	/**
	 * Get the Color we have currently set for drawing Wall objects.
	 * 
	 * @return
	 */
	public Color getWallColor() { return wallColor; }
	
	/**
	 * Update the Color we will use to draw Wall objects.
	 * 
	 * @param color
	 */
	public void setWallColor(Color color) { wallColor = color; }
	
	/**
	 * Get the Color we have defined for the JFrame background.
	 * 
	 * @return
	 */
	public Color getBackgroundColor() { return backgroundColor; }
	
	/**
	 * Update the Color we will use for the JFrame background.
	 * 
	 * @param color
	 */
	public void setBackgroundColor(Color color) { backgroundColor = color; }
	
	//////////////////////////////////////////////////////////
	// Private member variables
	//////////////////////////////////////////////////////////

	private int windowHeight;
	private int windowWidth;
	private int pixelOffsetX;
	private int pixelOffsetY;
	private int pixelScale;
	private Color wallColor;
	private Color backgroundColor;
}

// TODO: this should be a singleton class
